{{ if in .Site.Data.Solo.OldVersions  (strings.TrimPrefix "/gloo-edge/" $.Site.Data.Solo.DocsVersion) }}
  <div sytle="margin-right:5em;"><mark>You are viewing a previous version of Gloo Edge Docs. Select latest from the drop-down menu. </mark></div>
{{ end }}
<label for="version-selection" id="version-selection-label">Version:</label>
<select id="version-selection" onchange="javascript:location.href = this.value;">
  {{- range $version := append .Site.Data.Solo.OldVersions .Site.Data.Solo.DocsVersions }}
  {{ $versionNum := $version }}
  {{ if eq $versionNum $.Site.Data.Solo.LatestVersion }}
      {{ $version = "latest" }}
  {{ end }}
  <option value="/gloo-edge/{{ $version }}{{ $.RelPermalink}}" {{if eq (strings.TrimPrefix "/gloo-edge/" $.Site.Data.Solo.DocsVersion) $version }} selected{{end}}>
      {{ $versionNum }}
      {{ if eq $versionNum $.Site.Data.Solo.LatestVersion }}
        (latest)
      {{ end }}
  </option>
  {{ end }}
</select>